returning a count from months

I am looking to return a count from months. Example:

1/12/16

1/14/16

2/14/16

3/5/16


If these were in the same column I would want to return 2 for jan, 1 for feb, and 1 for march.


can anyone help me understand how to do this?

Posted on Sep 2, 2016 9:14 PM

Reply
2 replies

Sep 2, 2016 9:39 PM in response to abunce

ad an extra column and use the function month() to get just the month


then summarize by month by using the countif() function... like this:


User uploaded file


In the table on the left (named "Data") add a column (column B) and add the formula...

B2=IF(COUNTA(A2)>0, MONTH(A2), "")

this is shorthand for... select cell B2 then type (or copy and paste from here) the formula:

=IF(COUNTA(A2)>0, MONTH(A2), "")

select cell B2, copy

select cells B2 thru the end of column B, paste


now add second table (on the right in the screenshot above, titled "Date Summary")

in column place the month number as shown

B2=COUNTIF(Data::B, A2)


select cell B2, copy

select cells B2 thru the end of column B, paste

Sep 3, 2016 6:37 PM in response to abunce

If you like a compact approach you can do this with one formula, no extra columns, like this:


User uploaded file


The formula in B2, filled down, is:


=COUNTIFS(Table 1::A,">="&A2,Table 1::A,"<"&EDATE(A2,1))


COUNTIFS works with column-condition pairs. In this case it counts values in column A of Table 1 that are greater than or equal to the date to its left in the second table, and less then a month after the date to its left. (The EDATE simply adds 1 month here).


When you enter a month name column A the smart date recognition in Numbers interprets it as the beginning of the month. Note that this works "within the same year". If you change years you'll want to enter a full date in column A (i.e. including year, month, and date) then format so just the month name is showing.


SG

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

returning a count from months

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.